def quick_sort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[0]
    left = [x for x in arr if x < pivot]
    right = [x for x in arr if x > pivot]
    return quick_sort(left) + [pivot] + quick_sort(right)


arr = [45, 12, 78, 33, 9, 67, 29, 81, 5, 52]

if __name__ == '__main__':
    print(quick_sort(arr))
